<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html">
<body>
	<ui:composition>

		<table>
			<tr>
				<th><h:outputLabel for="projectId" value="Project/Department: " /></th>
				<th><h:outputLabel for="requisitionDate"
						value="Requisition Date" /></th>
				<th><h:outputLabel for="preparedBy" value="Prepared By" /></th>
				<th><h:outputLabel for="approvedBy" value="Approver" /></th>
				<th><h:outputLabel for="status" value="Status" /></th>
			</tr>
			<tr>
				<td><h:selectOneMenu id="projectId"
						value="#{detailBean.projectId}">
						<f:selectItems value="#{projectBean.projects}" var="project"
							itemValue="#{project.id}" itemLabel="#{project.code}" />
					</h:selectOneMenu></td>
				<td><h:inputText id="requisitionDate" value="#{detailBean.requisitionDate}" 
						readonly="true"	disabled="true">
						<f:convertDateTime type="date" pattern="MM/dd/yyyy" />
					</h:inputText></td>
				<td><h:inputText id="preparedBy" readonly="true"
						disabled="true" value="#{detailBean.preparedBy.displayName}" /></td>
				<td><h:selectOneMenu id="approvedBy"
						binding="#{detailBean.approverDropDown}"
						value="#{detailBean.approverId}">
						<f:selectItem itemValue="#{null}" itemLabel="Select approver..." />
						<f:selectItems value="#{detailBean.approvers}" var="approver"
							itemValue="#{approver.email}"
							itemLabel="#{approver.lastName}, #{approver.firstName}" />
					</h:selectOneMenu> <h:message for="approvedBy" style="color:red;" /></td>

				<td><h:inputText id="status" value="#{detailBean.status}"
						readonly="true" disabled="true" /></td>
			</tr>
			<tr>
				<th><h:outputLabel for="description" value="Description: " /></th>
				<td colspan="3"><h:inputText size="75" id="description"
						value="#{detailBean.description}" /></td>
				<td><h:commandButton styleClass="imgtxtbtn savebutton"
						rendered="#{purchaseRequisitionDetailBean.renderSave}"
						type="submit" value="Update"
						action="#{purchaseRequisitionDetailBean.save}"/>
					<h:commandButton styleClass="imgtxtbtn savebutton" type="submit" 
						rendered="#{purchaseRequisitionDetailBean.renderSubmit}"
						value="Submit PR" action="#{purchaseRequisitionDetailBean.submit}"/>
					<h:commandButton styleClass="imgtxtbtn deletebutton" type="submit" 
						rendered="#{purchaseRequisitionDetailBean.renderWithdraw}"
						value="Withdraw Submission" action="#{purchaseRequisitionDetailBean.withdraw}"/>
				</td>
			</tr>
		</table>
		<h:inputHidden id="id" value="#{detailBean.id}" />



	</ui:composition>
</body>
</html>